<div class="main-content">
    <h1><a name="Tenants"></a>Tenants</h1>

            <hr/>
            <h4 class="operation-heading"><a name="getTenantExistence"></a>Check whether the given tenant already exists</h4> <code>HEAD https://apis.wso2.com/api/am/publisher/v1/tenants/{tenantDomain}</code>
            <p class="marked"></p>

            <p class="marked">Using this operation, user can check whether a given tenant exists or not.
</p>

            <h4 class="section-heading">OAuth 2.0 Scope</h4>
                <code>apim:api_view</code>

            <h4 class="section-heading">
                Examples
            </h4>
            <h4 class="section-heading">
                <u>Get tenants by state</u>
            </h4>
                <div class="pointer" data-toggle="collapse" data-target="#request-getTenantExistence">
                    <h5 class="section-heading">
                        Request
                            <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
                    </h5>
                </div>
                    <div id="request-getTenantExistence"class="pre collapse in"><code class="json">GET https://localhost:9443/api/am/publisher/v1/tenants?state&#x3D;active HTTP 1/1
Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
</code></div>

                <div class="pointer" data-toggle="collapse" data-target="#response-getTenantExistence">
                    <h5 class="section-heading">
                        Response
                            <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
                    </h5>
                </div>
                    <div id="response-getTenantExistence" class="pre collapse in"><code class="json">HTTP 1/1 200 OK
Content-Type: application/json

{
  &quot;count&quot; : 3,
  &quot;list&quot; : [ {
    &quot;domain&quot; : &quot;test.com&quot;,
    &quot;status&quot; : &quot;ACTIVE&quot;
  }, {
    &quot;domain&quot; : &quot;carbon.super&quot;,
    &quot;status&quot; : &quot;ACTIVE&quot;
  }, {
    &quot;domain&quot; : &quot;test2.com&quot;,
    &quot;status&quot; : &quot;ACTIVE&quot;
  } ],
  &quot;pagination&quot; : {
    &quot;offset&quot; : 0,
    &quot;limit&quot; : 25,
    &quot;total&quot; : 3
  }
}</code></div>

                <h5 class="section-heading">CURL</h5>
                    <div class="pre"><code class="bash">curl -k -v -X GET &#39;https://localhost:9443/api/am/publisher/v1/tenants?state&#x3D;active&#39; -H &#39;Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8&#39; </code></div>

            <h4 class="section-heading">
                <u>Get tenant existence</u>
            </h4>
                <div class="pointer" data-toggle="collapse" data-target="#request-getTenantExistence">
                    <h5 class="section-heading">
                        Request
                            <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
                    </h5>
                </div>
                    <div id="request-getTenantExistence"class="pre collapse in"><code class="json">HEAD https://localhost:9443/api/am/publisher/v1/tenants/test.com HTTP 1/1
Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
</code></div>

                <div class="pointer" data-toggle="collapse" data-target="#response-getTenantExistence">
                    <h5 class="section-heading">
                        Response
                            <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
                    </h5>
                </div>
                    <div id="response-getTenantExistence" class="pre collapse in"><code class="json">HTTP 1/1 200 OK
Content-Type: application/json
</code></div>

                <h5 class="section-heading">CURL</h5>
                    <div class="pre"><code class="bash">curl -k -v -X HEAD &#39;https://localhost:9443/api/am/publisher/v1/tenants/test.com&#39; -H &#39;Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8&#39; </code></div>


            <h4 class="section-heading" id="scroll-to">Parameters</h4>
            <table class="table table-hover">
                <colgroup>
                    <col style="width: 10%;"/>
                    <col style="width: 20%;"/>
                    <col style="width: 40%;"/>
                    <col style="width: 10%;"/>
                    <col style="width: 20%;"/>
                </colgroup>
                <thead>
                <tr class="active">
                    <th>Type</th>
                    <th>Name</th>
                    <th>Description</th>
                    <th>Schema</th>
                    <th>Default</th>
                </tr>
                </thead>
                    <tr>
                        <td class="parameter">
                            
                            
                            <span class="param-in">Path </span>
                            
                            
                        </td>
                        <td class="param-name">
                            <p>tenantDomain</p>
                            <p class="param-required">
                                required
                                
                            </p>
                        </td>
                        <td>
                            <p class="param-description marked">The domain of a specific tenant
</p>
                        </td>
                        <td>
                            <span class="param-type">
                                String
                            </span>
                        </td>
                        <td>
                            <p class="marked"></p>
                        </td>
                    </tr>
            </table>

            <h4 class="section-heading">Responses</h4>

            <table class="table table-hover">
                <colgroup>
                    <col style="width: 15%;"/>
                    <col style="width: 70%;"/>
                    <col style="width: 15%;"/>
                </colgroup>
                <thead>
                <tr class="active">
                    <th>HTTP Code</th>
                    <th>Description</th>
                    <th>Schema</th>
                </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="parameter"><p class="marked">200</p></td>
                        <td class="parameter"><p class="marked">OK. Requested role name exists.</p></td>
                        <td class="parameter">
                            <span class="parameter">
                                    
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td class="parameter"><p class="marked">404</p></td>
                        <td class="parameter"><p class="marked">Not Found. Requested role name does not exist.</p></td>
                        <td class="parameter">
                            <span class="parameter">
                                    
                            </span>
                        </td>
                    </tr>
                </tbody>
            </table>
            <hr/>
            <h4 class="operation-heading"><a name="getTenantsByState"></a>Get get tenants by state
</h4> <code>GET https://apis.wso2.com/api/am/publisher/v1/tenants</code>
            <p class="marked"></p>

            <p class="marked">This operation is to get tenants by state
</p>

            <h4 class="section-heading">OAuth 2.0 Scope</h4>
                <code>apim:api_view</code>

            <h4 class="section-heading">
                Examples
            </h4>
            <h4 class="section-heading">
                <u>Get tenants by state</u>
            </h4>
                <div class="pointer" data-toggle="collapse" data-target="#request-getTenantsByState">
                    <h5 class="section-heading">
                        Request
                            <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
                    </h5>
                </div>
                    <div id="request-getTenantsByState"class="pre collapse in"><code class="json">GET https://localhost:9443/api/am/publisher/v1/tenants?state&#x3D;active HTTP 1/1
Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
</code></div>

                <div class="pointer" data-toggle="collapse" data-target="#response-getTenantsByState">
                    <h5 class="section-heading">
                        Response
                            <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
                    </h5>
                </div>
                    <div id="response-getTenantsByState" class="pre collapse in"><code class="json">HTTP 1/1 200 OK
Content-Type: application/json

{
  &quot;count&quot; : 3,
  &quot;list&quot; : [ {
    &quot;domain&quot; : &quot;test.com&quot;,
    &quot;status&quot; : &quot;ACTIVE&quot;
  }, {
    &quot;domain&quot; : &quot;carbon.super&quot;,
    &quot;status&quot; : &quot;ACTIVE&quot;
  }, {
    &quot;domain&quot; : &quot;test2.com&quot;,
    &quot;status&quot; : &quot;ACTIVE&quot;
  } ],
  &quot;pagination&quot; : {
    &quot;offset&quot; : 0,
    &quot;limit&quot; : 25,
    &quot;total&quot; : 3
  }
}</code></div>

                <h5 class="section-heading">CURL</h5>
                    <div class="pre"><code class="bash">curl -k -v -X GET &#39;https://localhost:9443/api/am/publisher/v1/tenants?state&#x3D;active&#39; -H &#39;Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8&#39; </code></div>

            <h4 class="section-heading">
                <u>Get tenant existence</u>
            </h4>
                <div class="pointer" data-toggle="collapse" data-target="#request-getTenantsByState">
                    <h5 class="section-heading">
                        Request
                            <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
                    </h5>
                </div>
                    <div id="request-getTenantsByState"class="pre collapse in"><code class="json">HEAD https://localhost:9443/api/am/publisher/v1/tenants/test.com HTTP 1/1
Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
</code></div>

                <div class="pointer" data-toggle="collapse" data-target="#response-getTenantsByState">
                    <h5 class="section-heading">
                        Response
                            <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
                    </h5>
                </div>
                    <div id="response-getTenantsByState" class="pre collapse in"><code class="json">HTTP 1/1 200 OK
Content-Type: application/json
</code></div>

                <h5 class="section-heading">CURL</h5>
                    <div class="pre"><code class="bash">curl -k -v -X HEAD &#39;https://localhost:9443/api/am/publisher/v1/tenants/test.com&#39; -H &#39;Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8&#39; </code></div>


            <h4 class="section-heading" id="scroll-to">Parameters</h4>
            <table class="table table-hover">
                <colgroup>
                    <col style="width: 10%;"/>
                    <col style="width: 20%;"/>
                    <col style="width: 40%;"/>
                    <col style="width: 10%;"/>
                    <col style="width: 20%;"/>
                </colgroup>
                <thead>
                <tr class="active">
                    <th>Type</th>
                    <th>Name</th>
                    <th>Description</th>
                    <th>Schema</th>
                    <th>Default</th>
                </tr>
                </thead>
                    <tr>
                        <td class="parameter">
                            
                            <span class="param-in">Query </span>
                            
                            
                            
                        </td>
                        <td class="param-name">
                            <p>state</p>
                            <p class="param-required">
                                
                                optional
                            </p>
                        </td>
                        <td>
                            <p class="param-description marked">The state represents the current state of the tenant

Supported states are [ active, inactive]
</p>
                                <p><b>Accepted values: </b></p>

<code>active</code>

<code>inactive</code>

                        </td>
                        <td>
                            <span class="param-type">
                                String
                            </span>
                        </td>
                        <td>
                            <p class="marked">active</p>
                        </td>
                    </tr>
                    <tr>
                        <td class="parameter">
                            
                            <span class="param-in">Query </span>
                            
                            
                            
                        </td>
                        <td class="param-name">
                            <p>limit</p>
                            <p class="param-required">
                                
                                optional
                            </p>
                        </td>
                        <td>
                            <p class="param-description marked">Maximum size of resource array to return.
</p>
                        </td>
                        <td>
                            <span class="param-type">
                                Integer
                            </span>
                        </td>
                        <td>
                            <p class="marked">25</p>
                        </td>
                    </tr>
                    <tr>
                        <td class="parameter">
                            
                            <span class="param-in">Query </span>
                            
                            
                            
                        </td>
                        <td class="param-name">
                            <p>offset</p>
                            <p class="param-required">
                                
                                optional
                            </p>
                        </td>
                        <td>
                            <p class="param-description marked">Starting point within the complete list of items qualified.
</p>
                        </td>
                        <td>
                            <span class="param-type">
                                Integer
                            </span>
                        </td>
                        <td>
                            <p class="marked">0</p>
                        </td>
                    </tr>
            </table>

            <h4 class="section-heading">Responses</h4>

            <table class="table table-hover">
                <colgroup>
                    <col style="width: 15%;"/>
                    <col style="width: 70%;"/>
                    <col style="width: 15%;"/>
                </colgroup>
                <thead>
                <tr class="active">
                    <th>HTTP Code</th>
                    <th>Description</th>
                    <th>Schema</th>
                </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="parameter"><p class="marked">200</p></td>
                        <td class="parameter"><p class="marked">OK. Tenant names returned. </p></td>
                        <td class="parameter">
                            <span class="parameter">
                                    <a href="#!/models#TenantList">TenantList</a>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td class="parameter"><p class="marked">404</p></td>
                        <td class="parameter"><p class="marked">Not Found. Requested application does not exist. </p></td>
                        <td class="parameter">
                            <span class="parameter">
                                    <a href="#!/models#Error">Error</a>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td class="parameter"><p class="marked">406</p></td>
                        <td class="parameter"><p class="marked">Not Acceptable. The requested media type is not supported </p></td>
                        <td class="parameter">
                            <span class="parameter">
                                    <a href="#!/models#Error">Error</a>
                            </span>
                        </td>
                    </tr>
                </tbody>
            </table>
</div>
